/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package desu.nya.DAO;

/**
 *
 * @author Fess
 */
public class AnimeFactory {
    private static AnimeDAO animeDAO=null;
    private static CoverDAO coverDAO=null;
    private static GenreDAO genreDAO=null;
    private static GenreListDAO genreListDAO=null;
    private static OtakuDAO otakuDAO=null;
    private static OwnerDAO ownerDAO=null;
    private static StudioDAO studioDAO=null;
    private static TypeEdDAO typeEdDAO=null;
    private static AnimeFactory instance=null;
    private static RatingDAO ratingDAO=null;
    
    public static synchronized AnimeFactory getInstance(){
        if(instance==null){
            instance =new AnimeFactory();
        }
        return instance;
    }

    public AnimeDAO getAnimeDAO() {
        if(animeDAO==null)animeDAO=new AnimeIMPL();
        return animeDAO;
    }

    public CoverDAO getCoverDAO() {
        if(coverDAO==null)coverDAO=new CoverIMPL();
        return coverDAO;
    }

    public GenreListDAO getGenreListDAO() {
        if(genreListDAO==null)genreListDAO=new GenreListIMPL();
        return genreListDAO;
    }

    public GenreDAO getGenreDAO() {
        if(genreDAO==null)genreDAO=new GenreIMPL();
        return genreDAO;
    }

    public OtakuDAO getOtakuDAO() {
        if(otakuDAO==null)otakuDAO=new OtakuIMPL();
        return otakuDAO;
    }

    public OwnerDAO getOwnerDAO() {
        if(ownerDAO==null)ownerDAO=new OwnerIMPL();
        return ownerDAO;
    }

    public StudioDAO getStudioDAO() {
        if(studioDAO==null)studioDAO=new StudioIMPL();
        return studioDAO;
    }

    public TypeEdDAO getTypeEdDAO() {
        if(typeEdDAO==null)typeEdDAO=new TypeEdIMPL();
        return typeEdDAO;
    }
    
    public RatingDAO getRatingDAO(){
        if(ratingDAO==null)ratingDAO=new RatingIMPL();
        return ratingDAO;
    }
    
}
